This page last changed on Feb 03, 2010 by bobh.

Which Linux?

We're using the Debian 4.0r7 'etch' release, which uses Linux kernel 2.6.18. As of this writing, Debian 5.0 'Lenny' has been released. But the drivers for the ConnectTech Xtreme/104-Plus Octal UART board doesn't work with any kernel newer than 2.6.23.

Using Debian allows us to leverage the MBARI knowledge with this release. I'm loosely following Thom Maughan's Wiki on configuring Debian for the AUV in addition to the Debian GNU/Linux Installation Guide.

Hardware setup

Set up PC-104 stack, including the CPU board (Lippert CoolRunner LX-800) and power supply board (Tri-M HE104+DX), as documented on the FOCE Electronics page, plus a 2.5" 160 GB Seagate hard disk drive.

  • Set up CPU and power supply board as above
  • Attach stack to power supply at +24 volts.  Don't turn it on yet
  • We now have a USB DVD drive, the Sony DRX-S70U.  Simply plug it in and attach to the USB port of the Lippert CoolRunner LX-800.  You'll need to configure the ROM BIOS in the LX-800 to boot from USB CD/DVD drive.
  • Attach the following to the CPU board, using their cable set:
    • Monitor (I used an LCD monitor)
    • Keyboard
    • Ethernet cable attached to building network
    • Two serial connectors, for testing serial ports when done.

Procedure

1) Install Base Debian System
  • Download the 'netinst' image of the Debian 'etch' release from http://www.debian.org (debian-40r7-i386-netinst.iso) and burn it to a CD. You can get an ISO image to burn onto a CD here
  • Power up the PC/104 stack (CPU + power supply)
  • Hit F1 and configure the CPU board to boot from the USB CD/DVD drive. You may want to set time & date while in the BIOS. (So far, we're using Pacific local time.) Save BIOS parameters and exit.
  • Boot from the Debian CD. Follow the prompts from the installer.
    • Hostname: foce6 (used foce1 to foce5 for the previous FOCE stacks). The intent is that subsequent boards will be foce7....
    • It should boot DHCP and find out that the domain is shore.mbari.org.
  • Partition -- Guided, use entire disk. (All files in 1 partition.) It will set up most of the disk as an ext3 partition, with a small (around 1.5 GB) swap area at the end.
  • Users: root and ops. Passwords same as on SIAM/MMC installations (see Bob, Tom, or Kent). The ops user is created with 'adduser ops'.
  • Use network mirror for complete install. You don't need a proxy. I didn't participate in installation survey.
  • Choose Standard System. Unselect Desktop environment.
  • Install GRUB to master boot record
  • When installation completes and the installer ejects the CD, power down the system (sync; shutdown). Remove the USB CD/DVD drive. (Radical users may just disconnect the drive with power on, then do 'sync; reboot'.
  • The moment of truth (stolen from the Debian Installation web page): Reapply power to the PC/104 stack and let it boot. GRUB will give you a choice between booting multi-user (default) or single-user; we want the default. It should boot into Debian Linux.
  • Log in as root.
2) A Little Bit of Reconfiguration
  • I edited the .bashrc for both root and ops to add my favorite aliases (e.g. ll). You can get my .bashrc here, or from the ops directory of another FOCE system.
  • Edit /boot/grub/menu.lst to shorten the delay before choosing the default (shortens boot time). 3 (seconds) is suggested.
  • Weirdness -- the host name (foce2) doesn't get published on the net during DHCP, though Thom reports that his installation worked fine out of the box. To enable publishing the host name, I had to edit /etc/dhcp3/dhclient.conf to add the following line:
    • send host-name "foce6.shore.mbari.org"
  • 'adduser bobh --uid 348' (to match my NIS user); you may want to add yourself instead, with your NIS id.
  • Edit /etc/group to add users ops, bobh, graybeal, headley, salamy to groups users, uucp, dialout (foce2 has "ops uucp dialout cdrom floppy audio video plugdev users io", but this does not seem necessary.)
  • If you want your network mount to be available, edit /etc/fstab to add the following lines. The bobh share has a few useful large files on it.
    • (Replace bobh with your network login.)
      # Create /tmp as a RAM disk, which speeds up compiles and the like
      tmp /tmp tmpfs defaults 0 0
      # NFS mount the bobh NIS directory. Set to noauto, so one must explicitly do a 'mount /mnt/bobh' to make it active.
      tempest:/vol/vol0/users/bobh /mnt/bobh nfs rw,bg,soft,noauto,nosuid,nodev,exec 0 0
      mkdir /mnt/bobh; chown bobh /mnt/bobh; chgrp users /mnt/bobh
      # (Do not mount the bobh share for deployments, it is for development only.)
  • Edit /boot/grub/menu.lst to send boot messages to both serial console and monitor, by adding the following lines (see Example 5-4 in http://www.tldp.net/HOWTO/Remote-Serial-Console-HOWTO/configure-kernel-grub.html
    • serial --unit=0 --speed=38400
    • terminal --timeout=5 serial console
    • Add the following to the end of the first 'kernel' line. (This sends boot messages to both the LCD screen and serial line. But I've noticed that it can't really keep up, and some lines are missing.)
      • console=tty0 console=ttyS0,38400n8
  • Edit /etc/inittab to do a 'getty' on ttyS0.  Uncomment and edit the appropriate line that was already there, so it reads
    T0:23:respawn:/sbin/getty -L /dev/ttyS0 38400 vt100
    Edit out the lines with ttyS2 through ttyS6.
  • Edit /etc/apt/sources.list to comment-out the reference to the cdrom. This prevents apt-get from trying to find packages on the CD drive that's no longer in the system.
  • Edit /etc/hosts. There should be a line that reads "127.0.0.1 localhost". Add the alias "loc" to the end
    of this line, so it reads "127.0.0.1 localhost loc"
  • Reboot (sync; reboot).
3) Install Package Add-ons

I installed many, but not all, of the packages documented on Thom's page. Many of these are probably not needed, but here's what I've done.

  • Run aptitude (as root), browse to 'Not Installed Packages->devel->main', and add:
    • autoconf
    • autogen
    • automake
    • binutils
    • bison
    • cccc
    • curves
    • cvs
    • g++ (pulls in gcc 4.1)
    • gdb
    • indent
    • libtool
    • linux-source-2.6.18
    • make
    • oprofile
    • subversion
  • While in aptitude, choose 'Not Installed Packages->editors, add emacs.  Install
  • 'Not Installed Packages->net->main, add ntp and ntpdate. Install. (Added 23may2008, rah)
    • Update /etc/ntp.conf to point to MBARI time servers.  You can get it here
  • Install the following with apt-get:
    • apt-get install openssl
    • apt-get install ssh
    • apt-get install setserial
    • apt-get install minicom
    • apt-get install kernel-package libncurses5-dev fakeroot wget build-essential (kernel build and debian package create)
    • apt-get install xutils-dev
    • apt-get install linux-doc-2.6.18
    • apt-get install linux-manual-2.6.18
    • apt-get install manpages-dev
    • apt-get install bin86 binutils gawk shellutils (/usr/share/doc/kernel-package/README.gz says we need these for a kernel build)
    • apt-get install sudo (more common alternative to fakeroot above)
    • apt-get install ethtool net-tools (Added 9jun2008, rah)
4) Prepare Linux Sources

We need to prepare the Linux sources to support the ConnectTech Xtreme-104 octal serial board. This board came with a CD that has patches for the 8250/16550 serial driver, and the instructions are to patch and rebuild the kernel. 

  • cd /usr/src
  • tar jxf linux-src-2.6.18.tar.bz2
  • cd linux-src-2.6.18
  • make clean; make mrproper
  • cp /boot/config-2.6.18-6-486 .config
  • make menuconfig
    • Processor type and features -> Processor family -> Geode GX/LX  (Why wasn't this already selected?)
    • Device Drivers->Character devices
    • deselect "Non-standard serial port support (CONFIG_SERIAL_NONSTANDARD)
    • These should already be selected; just make sure; in Serial drivers:
      • 8250/16550 and compatible serial support (CONFIG_SERIAL_8250)
      • Console on 8250/16550 serial port (CONFIG_SERIAL_8250_CONSOLE)
      • Extended 8250/16550 serial driver options (CONFIG_SERIAL_8250_EXTENDED)
      • Support for more than 4 legacy serial ports (CONFIG_SERIAL_8250_MANY_PORTS)
      • Support for sharing serial interrupts (CONFIG_SERIAL_8250_SHARE_IRQ)
    • Also set "Maximum number of8250/16550 serial ports" to 24, and "Number of serial ports to register at run time" to 20 (to support two octal serial boards).
5) Add Support for ConnectTech Xtreme/104-Plus Octal UART Board
  • mkdir /usr/src/xtreme104
  • Copy the Linux2.6 drivers (bhtnpciu-2.6.18v2.tar.gz) from the ConnectTech Xtreme/104-Plus CD to /usr/src/xtreme104.  You can get this file here.
  • Untar the file there.
  • Follow the instructions in the README file there, including the following steps:
  • cd /usr/src/linux-source.2.6.18
  • Make backup copies of directories drivers/serial and include/linux, so you can undo the patching in the next step, if necessary.
    • cd drivers; cp -r serial serial.save
    • cd ../include; cp -r linux linux.save
    • cd ..
  • patch -p1 < ../xtreme104/bhtnpciu-2.6.18/bhtnpciu-2.6.18.patch | tee patch.out
  • Look at the patch.out file generated above to verify that the patch succeeded.
  • Per the README, 'make menuconfig' and verify the options they list are set.  This was done above, and checked to be OK.
  • make-kpkg clean
  • make-kpkg --initrd --revision=foce.1.1 --append-to-version=-foce.1.1 kernel-image
    • Note that the second "foce.1.1" is preceded by a minus sign.
  • cd /usr/src; dpkg -i linux-image-2.6.18-foce.1.1_foce.1.1_i386.deb
  • Reboot
  • Verify that we have serial support via 'dmesg | grep tty'.  It should show ttyS4 through ttyS11 (or S19 for two serial boards).
  • Use minicom to test each serial port.  They work!  But you need to exit & reenter minicom when you change the serial port.

The intent is that if you need to build additional kernels for any reason, you'll follow the 'make-kpkg' and 'dpkg' commands above, replacing "foce.1.1" with "foce.1.2", "foce.1.3", etc, for subsequent builds.  For each kernel you build (denoted here as $KERNEL), this process generates:

  • /boot/config-$KERNEL
  • /boot/initrd-$KERNEL
  • /boot/System.map-$KERNEL
  • /boot/vmlinuz-$KERNEL
  • A directory named /lib/modules/$KERNEL
  • /usr/src/linux-image-$KERNEL_i386.deb.  This is the Debian package to install the kernel and modules

Note that the dpkg installer modifies /boot/grub/menu.lst to insert the new kernel as a boot option.  But when it does so, it removes the 'console=tty0 console=ttyS0,38400n8' from all the kernel lines.  These have to be manually reinserted on each kernel line if you want that kernel to send 'console' messages to the serial port as well as the LCD screen.

Future kernels will be built with sequential numbering -- foce.1.2, foce.1.3, etc.

6) NTP

On the deployed system, NTP wasn't peering with the time servers, as evidenced by 'ntpq -p'.  This time around, it seems to be working fine.  But if you have this problem, you need to install NTP later in the init cycle, as follows:

  •  Run 'update-rc.d -f ntp remove'
  • Add '/etc/init.d/ntp start' to /etc/rc.local
6) NTP and DataTurbine

3Feb2010, rah - I scrapped point 6 above and added the following to foce5 (recovered from Revelle deployment of Aug2009)

  • Run 'update-rc.d ntp defaults 97'
  • Run 'update-rc.d startDataTurbine defaults 98'

startDataTurbine is a script I created in /etc/init.d that looks like:

#!/bin/sh -e
#
# Start DataTurbine
#

PATH=.:/sbin:/bin:/usr/sbin:/usr/bin

export RBNB_HOME=/usr/local/RBNB/V3.2B2
export JAVA_HOME=/usr/java/jdk1.5.0_15
JARFILE=rbnb.jar

test -f $RBNB_HOME/bin/$JARFILE || exit 5

cd $RBNB_HOME/apache-tomcat-5.5.12/bin
startup.sh &> ../../apache.log
sleep 3
cd $RBNB_HOME
$JAVA_HOME/bin/java -jar bin/$JARFILE -a localhost:3333 -m 10,1000,200000 &> dat
aTurbine.log &

exit 0

Installing SIAM and FOCE on FOCE Stack

*You're now ready to install Java and SIAM.*Installing SIAM and FOCE on FOCE Stack

Document generated by Confluence on Feb 03, 2026 14:29